package basic_1017;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scanner=new Scanner(System.in);
		int num=scanner.nextInt();
		char star=scanner.next().charAt(0);
		scanner.close();
		
		int K=(int) Math.sqrt((num+1.0)/2);
		int rest=num-(2*K*K-1);

		for(int i=1-K;i<=K-1;i++) {
			for(int j=1-K;j<=K-1;j++) {
				if(Math.abs(j)<=Math.abs(i)) {
					System.out.print(star);
				}else {
					System.out.print(" ");
				}
			}
			System.out.print("\n");
		}
		System.out.println(rest);
		
	}
	
}
